<template>
    <div v-if="isVisible" class="popup-container">
      <div class="popup-content">
        <p @click="closePopup">{{ message }}</p>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    props: {
      isVisible: {
        type: Boolean,
        required: true,
      },
      message: {
        type: String,
        default: '',
      },
    },
    methods: {
      closePopup() {
        // 通过触发父组件的事件来关闭弹窗
        this.$emit('close');
      },
    },
  };
  </script>
  
  <style scoped>
  .popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius:15px;
  }
  
  .popup-content {
    text-align: center;
  }
  
  </style>
  